import os
import subprocess
import threading
import configs

base_conf = configs.Base()
if not os.path.exists(base_conf.log_dir):
    os.makedirs(base_conf.log_dir)

def run_app():
    #with open(f'{base_conf.log_dir}/app.log', 'w') as fout:
    #    subprocess.run(['python3', 'app.py'], stdout=fout, stderr=subprocess.STDOUT)
    subprocess.run(['python3', 'app.py'], stderr=subprocess.STDOUT)

app_thread = threading.Thread(target=run_app)
app_thread.start()

app_thread.join()
